package com.gary.spring.awreInit;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.Bean;

import javax.annotation.PostConstruct;
import java.sql.SQLOutput;

/**
 * @author peng_rui
 * @date 2022/6/26
 */
public class BeanCycle1 implements InitializingBean {
    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("执行InitializingBean.afterPropertiesSet()...");
    }

    @PostConstruct
    public void init() {
        System.out.println("执行BeanCycle1.@PostConstruct...");
    }

    public void initBean() {
        System.out.println("BeanCycle1.initBean...");
    }

    @Bean(initMethod = "initBean")
    public void afterInitBean() {
        System.out.println("BeanCycle1 AfterInitBean...");
    }
}
